package com.ithei.date.mydate;

import java.util.Calendar;

public class Calendar二月多少天 {
    public static void main(String[] args) {
        Calendar c1=Calendar.getInstance();
        c1.set(2021,2,1);

        c1.add(Calendar.DATE,-1);
        System.out.println("今年的二月有: "+c1.get(Calendar.DAY_OF_MONTH)+"天");


        Calendar c2=Calendar.getInstance();
        c2.set(2021,1,1);
        int i2 = c2.get(Calendar.DAY_OF_YEAR);
        int i1 = c1.get(Calendar.DAY_OF_YEAR);
        System.out.println(i1-i2+1);
    }
}
//母亲节5月的第二个星期二